package com.heima.user.v1.controller;

import com.heima.common.dtos.ResponseResult;
import com.heima.model.admin.dtos.LoginResultDTO;
import com.heima.model.user.dtos.AppLoginDto;
import com.heima.user.service.ApUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigurationPackage;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {

    @Autowired
    private ApUserService userService;

    @PostMapping("/api/v1/login/login_auth")
    public ResponseResult<LoginResultDTO> login(@RequestBody AppLoginDto dto){
        LoginResultDTO result = userService.login(dto);
        return ResponseResult.ok(result);
    }

}
